package com.infore.statisticsAndAlarm.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import com.infore.statisticsAndAlarm.select.util.PageObject;
import com.infore.statisticsAndAlarm.service.IGisDataService;
import com.infore.statisticsAndAlarm.util.ResultEntity;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;

@Api(value = "GIS首页调用到的接口", tags = { "GIS首页调用到的接口" })
@RestController
@RequestMapping("/gisData")
public class GISDataController {

	@Autowired
	private IGisDataService iGisDataService;
	
	@ApiOperation(value = "获取空气小时数据", notes = "获取空气小时数据")
    @ApiImplicitParams({@ApiImplicitParam(name = "mn", value = "站点mn号", paramType = "query", required = true, dataType = "String"),
         @ApiImplicitParam(name = "isNnusual", value = "是否查看异常数据all全部数据，unusual异常数据，normal正常数据", paramType = "query", required = true, dataType = "String")
    })
    @RequestMapping(value = "/queryHourDataAir", method = RequestMethod.GET)
    @ResponseBody
    public ResultEntity queryHourDataAir(String mn,String isNnusual,PageObject pageObject) throws Exception {
		return iGisDataService.queryHourDataAir( mn, isNnusual, pageObject);
	}
	
	@ApiOperation(value = "根据时间获取空气小时数据", notes = "根据时间获取空气小时数据")
    @ApiImplicitParams({@ApiImplicitParam(name = "startTime", value = "开始时间", paramType = "query", required = false, dataType = "String"),
         @ApiImplicitParam(name = "endTime", value = "结束时间", paramType = "query", required = false, dataType = "String")
    })
    @RequestMapping(value = "/queryHourDataAirByTime", method = RequestMethod.GET)
    @ResponseBody
    public ResultEntity queryHourDataAirByTime(String startTime,String endTime) {
		return iGisDataService.queryHourDataAirByTime(startTime, endTime);
	}
}
